package code

var ResponseCode map[string]string

/**
错误码，头两位代表业务类型，后三位代表具体的错误类型
*/
func init() {

	ResponseCode = make(map[string]string)

	ResponseCode["SUCCESS"] = "00000" //成功

	//用户关系
	ResponseCode["USER_NOT_EXIST"] = "10001"          //用户不存在
	ResponseCode["USER_PASS_ERROR"] = "10002"         //密码错误
	ResponseCode["USER_EXIST_OR_FAIL_PASS"] = "10003" //账号或者密码错误
	ResponseCode["LOGIN_CODE_ERROR"] = "10004"        //验证码错误
	ResponseCode["USER_ALREADY_EXISTS"] = "10005"     //账号已经重复
	ResponseCode["MOBILE_ALREADY_EXISTS"] = "10006"   //手机号已经重复
	ResponseCode["EMAIL_ALREADY_EXISTS"] = "10007"    //邮箱已经重复
	ResponseCode["OLD_PASS_ERROR"] = "10008"          //旧密码错误

	//数据描述
	ResponseCode["DATA_NOT_EXIST"] = "11001"     //数据不存在
	ResponseCode["DATA_ALREADY_EXIST"] = "11002" //数据重复了
	ResponseCode["KEY_ALREADY_EXIST"] = "11003"  //key重复了

	//系统错误
	ResponseCode["SYSTEM_ERROR_METHOD"] = "00001" //请求方法不正确
	ResponseCode["EXCEPTION_MESSAGE"] = "00002"   //异常信息，可以自定义信息
	ResponseCode["MODEL_NO_DEFINE"] = "00003"     //模型没有在控制器上定义
	ResponseCode["AUTH_NO_PASS"] = "00004"        //没有通过权限
	ResponseCode["UPLOAD_FAIL"] = "00005"         //文件上传失败
	ResponseCode["VALIDATE_FAIL"] = "00006"       //校验数据未通过
	ResponseCode["THIRD_API_FAIL"] = "00007"      //第三方接口失败
	ResponseCode["DIR_NOT_ACCESS"] = "00008"      //目录没有权限
	ResponseCode["FILE_TOO_BIG"] = "00009"        //文件太大

	initMsg()
}
